/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package main;

/**
 *
 * @author Administrator
 */
public class ItemBuy {

    protected int id;
    protected String name;
    protected int heureRemain;
    protected int minuteRemain;
    protected int isActive;

    public ItemBuy(int id, int isActive, int timeRemain) {
        this.id = id;
        this.name = getName(id);
        this.heureRemain = timeRemain / 60;
        this.minuteRemain = timeRemain % 60;
        this.isActive = isActive;
    }

    private String getName(int index) {
        if (GameData.getInstance().items == null) {
            return "";
        }
        return GameData.getInstance().items[index].name;
    }
}
